package com.example.pdm_project_group_001;

import android.app.Activity;
import android.app.Notification;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class Settings extends Activity {
	
	@Override
	protected void onCreate(Bundle savedInstanceState) 
	{
		Button btn;
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.settings);
		
		btn = (Button)findViewById(R.id.notifications);
		
		btn.setOnClickListener(new OnClickListener() 
		{
			
			public void onClick(View v) {

			      
			      NotificationManager notificationManager = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);

			      String MyText = "Reminder";
			      Notification mNotification = new Notification(R.drawable.bus_button, MyText, System.currentTimeMillis() );
			      
			      String MyNotificationTitle = "Bus Update";
			      String MyNotificationText  = "There are new updates available!";

			      Intent MyIntent = new Intent(Intent.ACTION_VIEW);
			      PendingIntent StartIntent = PendingIntent.getActivity(getApplicationContext(),0,MyIntent, PendingIntent.FLAG_CANCEL_CURRENT);
			      

			      mNotification.setLatestEventInfo(getApplicationContext(), MyNotificationTitle, MyNotificationText, StartIntent);

			      int NOTIFICATION_ID = 1;
			      notificationManager.notify(NOTIFICATION_ID , mNotification);  
			      
			    }
			});
		
		Button s2 = (Button)findViewById(R.id.reportIssues);
		
		s2.setOnClickListener(new OnClickListener() 
		{
			
			@Override
			public void onClick(View v) 
			{
				// TODO Auto-generated method stub
				startActivity(new Intent("com.example.pdm_project_group_001.ReportIssuesEmail"));
				
			}
			
		});
		
		
	}
	}



			
		